import cv2 as cv
#import numpy as np
#import matplotlib.pyplot as plt
filename = r'./lena.jpg'
img = cv.imread(filename) #读取图像文件
#显示原始图
cv.imshow("cource image", img)
cv.waitKey()
#均值滤波
img_mean = cv.blur(img, (5, 5))
cv.imshow("mean image", img_mean)
cv.waitKey()
# 高斯滤波
img_Guassian = cv.GaussianBlur(img, (5, 5), 0)
cv.imshow("guassian image", img_Guassian)
cv.waitKey()

# 中值滤波
img_median = cv.medianBlur(img, 5)
cv.imshow("median image", img_median)
cv.waitKey()
# 双边滤波
img_bilater = cv.bilateralFilter(img, 9, 75, 75)

cv.imshow("bilater image", img_bilater)
cv.waitKey()
cv.destroyAllWindows()
